﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <title>后台登录页面</title>
    <link href="~/css/layout.css" rel="stylesheet" />
    <link href="~/css/login.css?v=1.0" rel="stylesheet" />
    <style>
        .ibar {
            display: none;
        }
    </style>
</head>

<body class="login-bg">
    <div class="main ">
        <!--登录-->
        <div class="login-dom login-max">
            <div class="logo text-center">
                <a href="#">
                    <h1>登录后台</h1>
                </a>
            </div>
            <div class="login container " id="login">

                <form class="login-form" action="~/Login" method="post" autocomplete="off" id="frmLogin" data-validator-option="{timely:2, theme:'yellow_right_effect'}">
                    <div class="login-box border text-small" id="box">
                        <div class="name border-bottom">
                            <input type="text" placeholder="账号（随便填）" id="username" name="username" data-rule="账号:required;" />
                        </div>
                        <div class="pwd">
                            <input type="password" placeholder="密码（随便填）" datatype="*" id="password" name="password" data-rule="密码:required;"/>
                        </div>
                    </div>
                    <input type="submit" class="btn text-center login-btn" value="立即登录" />
                </form>
            </div>
        </div>
        <div class="footer text-center text-small ie">
            Copyright 2017-2018 版权所有 &copy; 2017-2018
            <span class="margin-left margin-right">|</span>
        </div> 
    </div>
</body>

<script src="~/js/jquery.min.js" type="text/javascript"></script> 
<script src="~/lib/nice-validator/jquery.validator.js?local=zh-CN"></script>
<script type="text/javascript">
     
    $(document).ready(function (e) {
        $('#frmLogin').validator({
            valid: function (form) {
                $.post($(this).attr("action"), $(form).serialize())
                    .done(function (d) { 
                        if (d.status == 200) {
                            alert("登录成功！");
                            location.href = "/";
                        } else {
                            alert(d.message);
                        }
                         
                    });
            }
        });

    });
</script>
</html>